importPackage(java.io);

load("scripts/test/test.js");
load("scripts/test/lib/config.js");
load("scripts/lib/panda/db.js");
load("scripts/test/lib/db/before.js");

(function(){
	var testCase = { name: function() { return "DB Test"; } };
	var files = File("scripts/test/lib/db").listFiles();
	panda.each(files, eachFile);
	test(testCase);

	function eachFile(file) {
		var name = (file.name + "");
		name = name.substr(0, name.length - 3);
		if (name === "before") { return; }

		var method = "test" + panda.upper(name);
		testCase[method] = function(){ execute(file); }
	}

	function execute(file) {
		load(file);
		run();
	}
}());
